/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryUserInfo;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryUserInfoSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryUserInfo record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_user_info");

                if (record.getNickName() != null) {
                    VALUES("nick_name", "#{nickName,jdbcType=VARCHAR}");
                }

                if (record.getAvatarUrl() != null) {
                    VALUES("avatar_url", "#{avatarUrl,jdbcType=VARCHAR}");
                }

                if (record.getGender() != null) {
                    VALUES("gender", "#{gender,jdbcType=TINYINT}");
                }

                if (record.getCity() != null) {
                    VALUES("city", "#{city,jdbcType=VARCHAR}");
                }

                if (record.getProvince() != null) {
                    VALUES("province", "#{province,jdbcType=VARCHAR}");
                }

                if (record.getCountry() != null) {
                    VALUES("country", "#{country,jdbcType=VARCHAR}");
                }

                if (record.getLanguage() != null) {
                    VALUES("language", "#{language,jdbcType=VARCHAR}");
                }

                if (record.getOpenId() != null) {
                    VALUES("open_id", "#{openId,jdbcType=VARCHAR}");
                }

                if (record.getUnionId() != null) {
                    VALUES("union_id", "#{unionId,jdbcType=VARCHAR}");
                }

                if (record.getRole() != null) {
                    VALUES("role", "#{role,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryUserInfo record) {
        return new SQL() {
            {
                UPDATE("delivery_user_info");

                if (record.getNickName() != null) {
                    SET("nick_name = #{nickName,jdbcType=VARCHAR}");
                }

                if (record.getAvatarUrl() != null) {
                    SET("avatar_url = #{avatarUrl,jdbcType=VARCHAR}");
                }

                if (record.getGender() != null) {
                    SET("gender = #{gender,jdbcType=TINYINT}");
                }

                if (record.getCity() != null) {
                    SET("city = #{city,jdbcType=VARCHAR}");
                }

                if (record.getProvince() != null) {
                    SET("province = #{province,jdbcType=VARCHAR}");
                }

                if (record.getCountry() != null) {
                    SET("country = #{country,jdbcType=VARCHAR}");
                }

                if (record.getLanguage() != null) {
                    SET("language = #{language,jdbcType=VARCHAR}");
                }

                if (record.getOpenId() != null) {
                    SET("open_id = #{openId,jdbcType=VARCHAR}");
                }

                if (record.getUnionId() != null) {
                    SET("union_id = #{unionId,jdbcType=VARCHAR}");
                }

                if (record.getRole() != null) {
                    SET("role = #{role,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}